/*
 * This is the extension activity for the 'send' activity associated
 * with service '{http://www.pi4soa.org/AuctionHouseBuyer}Buyer'
 * and behavior 'main_Buyer'. The name of the send
 * activity is 'BidRequest'.
 */
package org.pi4soa.auctionhousebuyer.buyer.main_buyer;

import org.pi4soa.service.extensions.DefaultActivityExtension;
import org.pi4soa.service.extensions.SendActivityExtension;
import org.pi4soa.service.extensions.ExtensionContext;
import org.pi4soa.service.UnresolvedConstraintException;
import org.pi4soa.service.ServiceException;
import org.pi4soa.service.DeferProcessingException;

/**
 * This class has been autogenerated to implement the custom send activity
 * within a service endpoint description.
 */
public class BidRequestSend extends DefaultActivityExtension implements
		SendActivityExtension {

	/**
	 * The constructor for the send activity extension.
	 */
	public BidRequestSend() {
	}

	/**
	 * This method returns the contents that should be sent by the send activity
	 * within the behavioral model.
	 * 
	 * @param context
	 *            The context
	 * @return The message content
	 * @exception UnresolvedConstraintException
	 *                Delay sending the message until a constraint is satisfied
	 * @exception DeferProcessingException
	 *                Suspend processing
	 * @exception ServiceException
	 *                Failed to get message content
	 */
	public java.io.Serializable getMessageContent(ExtensionContext context)
			throws UnresolvedConstraintException, DeferProcessingException,
			ServiceException {
		java.io.Serializable ret;

		if (context.isVariableAvailable("bidRequestTestData"))
			ret = context.getVariable("bidRequestTestData");
		else
			ret = "<BidRequest userId=\"42\"><itemId>1</itemId>"
					+ "<currentBid>2500</currentBid></BidRequest>";

		return (ret);
	}
}